# from wtforms import form, fields, validators
# from CourseScheduling.blueprints.user.models import User
#
# # Define login and registration forms (for flask-login)
# class LoginForm(form.Form):
#     email = fields.StringField(validators=[validators.required()])
#     password = fields.PasswordField(validators=[validators.required()])
#
#     def validate_login(self, field):
#         user = self.get_user()
#
#         if user is None:
#             raise validators.ValidationError('Invalid user')
#
#         if user.password != self.password.data:
#             raise validators.ValidationError('Invalid password')
#
#     def get_user(self):
#         return User.objects(email=self.email.data).first()
